package com.tiantianfresh.admin.service.Impl;

import com.tiantianfresh.admin.service.AllocationService;
import com.tiantianfresh.model.dao.CommodityAllocationMapper;
import com.tiantianfresh.model.pojo.CommodityAllocation;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class AllocationServiceImpl implements AllocationService {
    @Resource
    private CommodityAllocationMapper allocationMapper;
    //查询全部方法
    @Override
    public List<CommodityAllocation> selectAll() {
        return allocationMapper.selectAll();
    }
    //根据id删除
    @Override
    public int deleteAllocationById(int id) {
        return allocationMapper.deleteAllocationById(id);
    }
    //添加一个Allocation
    @Override
    public int addAllocation(CommodityAllocation allocation) {
        return allocationMapper.addAllocation(allocation);
    }
    //根据id查询Allocation
    @Override
    public CommodityAllocation queryAllocationById(int id) {
        return allocationMapper.queryAllocationById(id);
    }
    //修改Allocation
    @Override
    public int updateAllocation(CommodityAllocation allocation) {
        return allocationMapper.updateAllocation(allocation);
    }
}
